package com.googlecode.scup.parser.actionstates;

import com.googlecode.scup.grammar.grammarspart.Symbol;
import com.googlecode.scup.parser.InputStream;

import java.util.Stack;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.List;

public class ShiftAction implements ActionState {
	private int nextState;

	public ShiftAction(int state) {
		this.nextState = state;
	}

	@Override
	public ActionStateType getType() {
		return ActionStateType.SHIFT;
	}

    @Override
    public void doAction(Stack<Symbol> symbolsStack, Stack<Integer> states, InputStream inputStream, List<Map<Symbol, ActionState>> Goto) {
        symbolsStack.push(inputStream.getToken());
        states.push(nextState);
        inputStream.nextToken();
    }

//    @Override
//	public void doAction() {
//	}

    @Override
    public String toString() {
        return new String("s " + nextState);
    }
}
